package main

import "fmt"

type student struct {
	name string
	age  int
}

func test1() {
	m := make(map[string]*student)
	stus := []student{
		{name: "pprof.cn", age: 18},
		{name: "测试", age: 23},
		{name: "博客", age: 28},
	}

	for _, stu := range stus {
		temStu := stu
		m[stu.name] = &temStu
		/*	fmt.Printf("%p ---> %p\n", &k, &stu)
			fmt.Println("stu.name=", stu.name, " ---> ", &stu)*/
	}
	fmt.Println()
	for k, v := range m {
		fmt.Println(k, "=>", v.name)
	}
}

type Address struct {
	Province string
	City     string
}

type User struct {
	Name    string
	Gender  string
	Address Address
}

func main() {
	user1 := User{
		Name:   "小明",
		Gender: "男",
		Address: Address{
			Province: "湖北",
			City:     "武汉",
		},
	}

	fmt.Printf("user1= %#v\n", user1)
}
